package com.synjones.zeus.model.merchant;

/**
 * 启用禁用状态
 * Created by liubinqiang on 2018/5/2.
 */
public enum MerchantStatus {

    _0("0", "正常"),
    _1("1", "冻结"),
    _2("2", "已销户");
    private final String code;// 状态码
    private final String desc;// 状态码描述

    MerchantStatus(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String code() {
        return code;
    }

    public String desc() {
        return desc;
    }

    /**
     * *
     * 根据code获取描述
     *
     * @param code
     * @return
     */
    public static String getDesc(String code) {

        for (MerchantStatus info : MerchantStatus.values()) {
            if (code.equals(info.code)) {
                return info.desc;
            }
        }
        return null;
    }
}
